var mysql = require('mysql');
//var ou = require('../objectUtil');
//ou.allMembers(mysql);

var client = mysql.createConnection({
	host : 'localhost',//可省略，默认即为本地地址
	port : 3306,//可省略，默认即为3306
	user : 'root',
	password : '',
	database : 'book',
	debug : true
});
/**/
//var client = mysql.createConnection("mysql://root:123456@localhost/book?debug=true&charset=UTF-8");
client.query('select * from book_ limit 1',
function(err, results, fields){
	if(err){
		throw err;
	}
	if(results.length > 0){
		console.log('name:' + results[0]['name']);
		console.log('author:' + results[0]['author']);
		console.log('url:' + results[0]['url']);
		console.log('sourceUrl:' + results[0]['sourceUrl']);
		console.log('download_times:' + results[0]['download_times']);
	}
	client.end();
});